﻿using System;
using System.Runtime.InteropServices;

namespace Vtron.HipcConfigurationTools.Domain
{
    /// <summary>
    /// 时间获取的请求
    /// </summary>
    /// <remarks>
    /// typedef  struct
    /// {
    ///     T_HIPC_NET_HEADER    head;
    ///     Uint8    ntpEnable;  //  0:close  1:open
    ///     Uint8    ntpServer[IP_CODEC_IP_LEN];   //ntp 服务器的ip地址
    ///     Uint32             cycleSec;//间隔周期 秒为单位
    ///     Uint16             timeZone; //时区
    ///     Uint16             port;//端口
    ///     T_SYS_TIME time;         // 当前系统时间
    /// } T_HIPC_TIME_GET_REQ;
    /// </remarks>
    [Serializable]
    [StructLayout(LayoutKind.Sequential, Pack = 1)]
    public struct T_HIPC_TIME_GET_REQ
    {
        #region Fields

        /// <summary>
        /// 网络协议数据头
        /// </summary>
        public T_HIPC_NET_HEADER head;

        /// <summary>
        /// 0:close  1:open
        /// </summary>
        public byte ntpEnable;

        /// <summary>
        /// ntp 服务器的ip地址
        /// </summary>
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
        public byte[] ntpServer;

        /// <summary>
        /// 间隔周期 秒为单位
        /// </summary>
        public UInt32 cycleSec;

        /// <summary>
        /// 时区
        /// </summary>
        public UInt16 timeZone;

        /// <summary>
        /// 端口
        /// </summary>
        public UInt16 port;

        /// <summary>
        /// 当前系统时间
        /// </summary>
        public T_SYS_TIME time;

        #endregion
    }
}
